FROM registry.cn-hangzhou.aliyuncs.com/shalousun/alpine-openjdk17:1.0.0

MAINTAINER shalousun
EXPOSE 8080

# install Spring Boot artifact
VOLUME /tmp
ADD springboot-docker.jar springboot-docker.jar
RUN sh -c 'touch /springboot-docker.jar'
# default profiles
ENV PROFILES="container"
# set jvm
ENV JAVA_OPTS="-server -Xmx512m -Xms512m -Djava.awt.headless=true"
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar -Dspring.profiles.active=$PROFILES /springboot-docker.jar" ]